{
    NSString * stringTemp = @"Error creating regex";
    if (stringTemp.length > 240) {
       NSError *error = NULL;
       NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\b(https?://)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,}\\b"
                                                                             options:NSRegularExpressionCaseInsensitive
                                                                               error:&error];
       if (error) {
           NSLog(@"Error creating regex: %@", error.localizedDescription);
       }
       NSArray<NSTextCheckingResult *> *matches = [regex matchesInString:stringTemp
                                                                 options:0
                                                                   range:NSMakeRange(0, [stringTemp length])];
       NSMutableArray<NSString *> *results = [NSMutableArray array];
       for (NSTextCheckingResult *match in matches) {
           if ([match numberOfRanges] > 0) {
               NSString *matchedString = [stringTemp substringWithRange:[match rangeAtIndex:0]];
               [results addObject:matchedString];  // 添加匹配的字符串
           }
       }
    }
}
